package com.myschool.server.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="work")
public class Work extends BaseEntity {
	@Column(name="work_type",nullable=false)
	private String type;
	@Column(name="work_name",length=256,nullable=false)
	private String name;
	@Column(length=512,nullable=false)
	private String description;
	@ManyToOne(cascade=CascadeType.ALL,targetEntity=Subject.class,fetch=FetchType.LAZY)
	private Subject subject;
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Subject getSubject() {
		return subject;
	}
	public void setSubject(Subject subject) {
		this.subject = subject;
	}
}
